package com.nerve.secondhandcar.domain.car;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.nerve.secondhandcar.domain.Car;

/**
 * @project: secondHandCarPlatform
 * @file: Configure.java
 * @package: com.nerve.secondhandcar.domain.car
 * @description:
 *	汽车配置
 * @author: 集成显卡	1053214511@qq.com
				IBM GDC, zengxm@cn.ibm.com
 * @date&time: 2014-10-9
 * @change log:
 */
@Table(name="CAR_CONFIGURE")
@Entity
@SuppressWarnings("serial")
public class Configure extends CarChild{
	
	private String factory;					//生产厂家
	private String door;					//车门数
	private String seat;					//座位数
	private String length;					//长
	private String width;					//宽
	private String height;					//高
	private String category;				//车身形式，如：SUV，小型车，两厢，三厢等
	private String wheel;					//轴距（mm）
	private String weight;					//整车重量，单位KG
	private String tank;					//油箱，单位L
	private String trunk;					//行李箱体积，单位L
	
	private ConfigureMotor motor;
	private ConfigureBottom bottom;
	private ConfigureControl control;
	private ConfigureIn in;
	private ConfigureMedia media;
	private ConfigureOut out;
	private ConfigureSecurity security;
	
	public Configure() {
	}
	
	public Configure(Car car){
		if(car != null){
			this.motor = new ConfigureMotor();
			this.bottom = new ConfigureBottom();
			this.control = new ConfigureControl();
			this.in = new ConfigureIn();
			this.media = new ConfigureMedia();
			this.out = new ConfigureOut();
			this.security = new ConfigureSecurity();
		}
	}
	
	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="bottom_id", insertable=true)
	public ConfigureBottom getBottom() {
		return bottom;
	}
	public void setBottom(ConfigureBottom bottom) {
		this.bottom = bottom;
	}
	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="control_id", insertable=true)
	public ConfigureControl getControl() {
		return control;
	}
	public void setControl(ConfigureControl control) {
		this.control = control;
	}
	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="in_id", insertable=true)
	public ConfigureIn getIn() {
		return in;
	}
	public void setIn(ConfigureIn in) {
		this.in = in;
	}
	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="media_id", insertable=true)
	public ConfigureMedia getMedia() {
		return media;
	}
	public void setMedia(ConfigureMedia media) {
		this.media = media;
	}
	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="out_id", insertable=true)
	public ConfigureOut getOut() {
		return out;
	}
	public void setOut(ConfigureOut out) {
		this.out = out;
	}
	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="security_id", insertable=true)
	public ConfigureSecurity getSecurity() {
		return security;
	}
	public void setSecurity(ConfigureSecurity security) {
		this.security = security;
	}
	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="motor_id", insertable=true)
	public ConfigureMotor getMotor() {
		return motor;
	}
	public void setMotor(ConfigureMotor motor) {
		this.motor = motor;
	}
	public String getFactory() {
		return factory;
	}
	public void setFactory(String factory) {
		this.factory = factory;
	}
	public String getDoor() {
		return door;
	}
	public void setDoor(String door) {
		this.door = door;
	}
	public String getSeat() {
		return seat;
	}
	public void setSeat(String seat) {
		this.seat = seat;
	}
	public String getLength() {
		return length;
	}
	public void setLength(String length) {
		this.length = length;
	}
	public String getWidth() {
		return width;
	}
	public void setWidth(String width) {
		this.width = width;
	}
	public String getHeight() {
		return height;
	}
	public void setHeight(String height) {
		this.height = height;
	}
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getWheel() {
		return wheel;
	}
	public void setWheel(String wheel) {
		this.wheel = wheel;
	}
	public String getWeight() {
		return weight;
	}
	public void setWeight(String weight) {
		this.weight = weight;
	}
	public String getTank() {
		return tank;
	}
	public void setTank(String tank) {
		this.tank = tank;
	}
	public String getTrunk() {
		return trunk;
	}
	public void setTrunk(String trunk) {
		this.trunk = trunk;
	}
}